"""
Case Type   : Log_Max_Size
Case Name   : 查看参数log_max_size默认值，默认值为0
Create At   : 2024/10/23
Owner       : liu-tong-8848
Description :
              1.查看参数log_max_size默认值
Expect      :
              1.默认值为0
History     :
"""

import os
import unittest

from testcase.utils.CommonSH import CommonSH
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
from yat.test import Node


class SQL(unittest.TestCase):
    def setUp(self):
        self.log = Logger()
        self.constant = Constant()
        self.primary_sh = CommonSH('PrimaryDbUser')
        self.db_user_node = Node(node='PrimaryDbUser')

    def test_add_dimension(self):
        self.log = Logger()
        self.log.info(f'-----{os.path.basename(__file__)} start-----')
        step1 = '--step1.查看参数log_max_size默认值;expect:默认值为0'
        self.log.info(step1)
        sql = "show log_max_size;"
        self.log.info(sql)
        result = self.primary_sh.execut_db_sql(sql)
        self.log.info(result)
        self.assertIn("0", result, "执行失败" + step1)
        self.assertNotIn("ERROR", result, "执行失败" + step1)


    def tearDown(self):
        self.log.info(f'-----{os.path.basename(__file__)} end-----')
